<template>
	<view class="login">
		<view class="element">
			<view class="backHome" @click="backHome" :style="{paddingTop: safeArea_top + 'px'}">
				<u-icon name="arrow-left" color="#fff" size="22"></u-icon>
			</view>
			<p>Hi</p>
			<p>WELCOME</p>
			<p class="title">貂蝉到家</p>
		</view>
		<view class="container">
			<view class="form">
				<view class="h1"> 手机快捷登录 </view>
				<view class="p">未注册过的手机将自动创建账号</view>

				<view class="label">账号</view>
				<view class="item">
					<!-- <uv-input v-model="username" placeholder="请输入账号" prefixIcon="account" border="bottom" prefixIconStyle="font-size: 22px;color: #909399"></uv-input> -->
					<input type="number" v-model="phone" placeholder="输入手机号"
						placeholder-style="color:rgba(153, 153, 153, 1)" />
				</view>
				<view class="label">密码</view>
				<view class="item">
					<!-- <uv-input v-model="password" type="password" placeholder="请输入密码" prefixIcon="lock"  border="bottom" prefixIconStyle="font-size: 22px;color: #909399"></uv-input> -->
					<input type="number" v-model="phone" placeholder="输入手机号"
						placeholder-style="color:rgba(153, 153, 153, 1)" />
				</view>
				<view class="submit-content">
					<view class="submit" @click="submit">
						立即登录
					</view>
				</view>
			</view>
		</view>

		<view class="other">
			<view v-if="false">其他登录方式</view>
			<image class="wx" src="../../static/icon/icon_wechat.png" mode="" @click="wxLogin" v-if="false"></image>
			<view>
				<u-checkbox-group placement="row" v-model="treaty" style="display: flex; align-items: center">
					<u-checkbox activeColor="#38987c" name="1" style="font-size: 20rpx"></u-checkbox>
					<text>
						<text style="color: #333">登陆即同意</text>
						<text @tap.stop="topath('privacy')">《隐私政策》</text>
						<text style="color: #333">和</text>
						<text @click="topath('service')">《服务条款》</text>
					</text>
				</u-checkbox-group>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				treaty: ["1"],
				phone: "",
				code: "",
				msg: "获取验证码",
				is_ios: 0,
				isDev: false,
				logoUrl: "",
				wx_config: "",
				name: "",
				onClick: true,
				safeArea_top: 0,
				deviceId: ''
			};
		},
		async onLoad() {
			const info = uni.getSystemInfoSync();
			// const platform = info.platform;
			// console.log('iOS 设备唯一标识:', info.deviceId);

			// 0468AF0DE7097589CD56E94614251FD8 - redmi
			// F92416BF7309F0B1B9D9B7CEBF052BA3 - xiaomi
			// console.log('设备信息ID:',info.deviceId);
			this.deviceId = info.deviceId



			const safeArea = uni.getStorageSync('safeArea')
			// this.safeArea_top = safeArea.top
			if (!safeArea) {
				uni.getSystemInfo({
					success(res) {
						uni.setStorageSync("safeArea", res.safeArea);
						this.safeArea_top = res.safeArea.top
					},
				});
			} else {
				this.safeArea_top = safeArea.top
			}
		},
		methods: {
			submit() {
				// this.$http.http("masterchannel/login/index",{
				// 	username: this.username,
				// 	password: this.password
				// }).then(res=>{
				// 	this.$http.tips(res.msg)
				// 	uni.setStorageSync('token', res.data.token)
				// 	uni.switchTab({
				// 		url: "/pages/index/index"
				// 	})
				// })
			}
		}
	}
</script>

<style lang="scss">
	.login {
		width: 100%;
		height: 100vh;
		position: relative;
	}

	.element {
		width: 100%;
		height: 50%;
		color: #fff;
		font-size: 70rpx;
		font-family: monospace;
		padding: 0 60rpx 60rpx;
		letter-spacing: 6rpx;
		box-sizing: border-box;
		background: linear-gradient(90deg, #38987c 50%, #89b4a8 100%);
		clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%);

		.title {
			margin-top: 30rpx;
		}

		.backHome {
			padding-bottom: 120rpx;
		}
	}

	.container {
		position: relative;
		z-index: 10;
		margin-top: -220rpx;
		width: 100%;
		padding: 0rpx 60rpx;
		box-sizing: border-box;

		.form {
			position: relative;
			border-radius: 16rpx;
			color: #909399;
			font-size: 28rpx;
			background: #fff;
			box-shadow: 0px 8px 15px 1px rgba(0, 0, 0, 0.3);
			padding: 10rpx 40rpx 100rpx;
			
			.h1 {
				color: rgba(41, 41, 41, 1);
				font-size: 40rpx;
				font-weight: bold;
				margin-bottom: 30rpx;
				position: relative;
				z-index: 999;
			}
			
			.p {
				color: rgba(153, 153, 153, 1);
				font-size: 24rpx;
				margin-bottom: 60rpx;
			}
			

			.label {
				margin-bottom: 15rpx;
			}

			.item {
				margin-bottom: 40rpx;
			}

			.submit-content {
				width: 100%;
				display: flex;
				justify-content: center;
				position: absolute;
				bottom: -40rpx;
				left: 50%;
				transform: translateX(-50%);
			}

			.submit {
				color: #fff;
				width: 70%;
				height: 80rpx;
				border-radius: 40rpx;
				text-align: center;
				line-height: 80rpx;
				background: linear-gradient(90deg, #38987c 50%, #89b4a8 100%);
				transition: all 0.2s ease;
				/* 添加过渡动画 */
			}

			/* 鼠标悬停效果（PC端） */
			.submit:hover {
				transform: scale(1.03);
				/* 轻微放大 */
				box-shadow: 0 8rpx 20rpx rgba(84, 198, 253, 0.3);
				/* 增加投影 */
			}

			/* 点击按下效果（所有端） */
			.submit:active {
				transform: scale(0.97);
				/* 点击时轻微缩小 */
				opacity: 0.8;
				/* 降低透明度 */
			}
		}
	}

	.other {
		position: fixed;
		width: 100%;
		bottom: 74rpx;
		left: 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		view:first-of-type {
			color: rgba(153, 153, 153, 1);
			font-size: 24rpx;
		}

		.wx {
			width: 96rpx;
			height: 96rpx;
			margin: 32rpx 0 80rpx 0;
		}

		view:last-of-type {
			font-size: 24rpx;
			color: rgba(102, 102, 102, 1);

			text {
				color: #38987c;
			}
		}
	}
</style>